#pragma once
#include "Header.h"

#define USTRING_CALLOUT_CONNECT_V4_NAME     L"CONNECT V4 CALLOUT NAME"
#define USTRING_CALLOUT_CONNECT_V4_DESC     L"CONNECT V4 CALLOUT DESCRIPTION"
#define USTRING_FILTER_CONNECT_V4_NAME      L"CONNECT V4 FILTER NAME"
#define USTRING_FILTER_CONNECT_V4_DESC      L"CONNECT V4 FILTER DESCRIPTION"

// {6878D5E4-AE97-4857-A728-8034A51F46AD}
DEFINE_GUID(CALLOUT_CONNECT_V4, 
0x6878d5e4, 0xae97, 0x4857, 0xa7, 0x28, 0x80, 0x34, 0xa5, 0x1f, 0x46, 0xad);

NTSTATUS WfpInitialize();

void WfpCleanUp();

NTSTATUS WfpRegisterCallOut(
    IN PDEVICE_OBJECT lpDeviceObject,
    IN const GUID* lpGuidCalloutKey,
    IN FWPS_CALLOUT_CLASSIFY_FN ClassifyFn,
    IN FWPS_CALLOUT_NOTIFY_FN NotifyFn,
    IN FWPS_CALLOUT_FLOW_DELETE_NOTIFY_FN DeleteNotifyFn,
    OUT UINT32* lpCallOutId
);

NTSTATUS WfpAddCallOut(
    HANDLE hFilerEngine,
    IN const GUID* lpCalloutKey,
    IN const GUID* lpApplicableLayer,
    IN PWCHAR lpwszName,
    IN PWCHAR lpwszDescription
);

NTSTATUS WfpAddFilter(
    IN HANDLE hFilerEngine,
    IN PWCHAR lpwszName,
    IN PWCHAR lpwszDescription,
    IN const GUID* lpLayerKey,
    IN const GUID* lpSubLayerKey,
    IN const GUID* lpActionCalloutKey,
    IN FWP_DATA_TYPE WeightType,
    IN FWP_ACTION_TYPE ActionType,
    IN UINT32 numFilterConditions,
    IN FWPM_FILTER_CONDITION* lpFilterCondition,
    OUT PUINT64 lpFilterId
);